package com.seago.iceberg.config;

import com.seago.iceberg.repository.IcebergRepository;
import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.AnnotationMetadata;

/**
 * Title:
 * <p>
 * description:
 *
 * @Company: 中国船舶集团海舟系统技术有限公司-武汉
 * @author: yangs
 * @since: 2023-05-09 10:42
 * @version: 1.0
 **/
public class ClassPathScanningCandidateComponentProviderSupport extends ClassPathScanningCandidateComponentProvider {

	public ClassPathScanningCandidateComponentProviderSupport(boolean useDefaultFilters) {
		super(useDefaultFilters);
	}

	@Override
	protected boolean isCandidateComponent(AnnotatedBeanDefinition beanDefinition) {
		AnnotationMetadata metadata = beanDefinition.getMetadata();
		return !IcebergRepository.class.getName().equals(metadata.getClassName()) && metadata.isInterface();
	}


}
